package com.loiot.baqi.vo;

import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.loiot.baqi.pojo.AccountExpandInfo;
import com.loiot.commons.utils.DateUtil;
@Data
@EqualsAndHashCode(callSuper = false)
public class JlAuditPersonList {
	
	private String auditPersonName;
	private Long auditPerson;
	private Date lastAuditTime;
	private int auditCount;
	private int waitAuditCount;
	private int allowMaxAuditCount;  
	private int todayAuditCount;
	
	public String getLastAuditTimeStr(){
		String dayStr="无";
		if(this.getLastAuditTime()!=null){
			int  dayCount =DateUtil.compareDate( DateUtil.toString(this.getLastAuditTime()),DateUtil.getCurrentDate(), 0);
			if(dayCount==0){
				dayStr="今日";
			}else {
				dayStr=dayCount+"天前";
			}
		}
		return dayStr;
	}
	public int getAllowAuditCount(){
		//如果有3个未评审 就不能选择此技术经理评审了
		if(3<=this.getWaitAuditCount()){
			return 0;
		}
		//技术经理设置允许评审数 减去  今天选择这个技术经理的数 = 0 （还可以允许评审数）
		int count =this.getAllowMaxAuditCount()-this.getWaitAuditCount();
		return count<0 ?0 : count;
		//return this.allowMaxAuditCount-this.getWaitAuditCount();
	}
}
